<?php
/**
 * Created by PhpStorm.
 * User: alice
 * Date: 2015/12/28
 * Time: 12:26
 */

/**
 * Class Involved_CircleCommentModel
 */
class Involved_CircleCommentModel extends BaseModel{

    protected $table = 'circle_comment';

    /**
     * 获取木业圈动态评论信息
     * @return mixed
     * @author alice
     * @date 2016-1-27
     */
    public function GetCircleList($circle_id)
    {
        #木业圈动态信息
        $info = DB::table($this->table)
            ->leftJoin('user','circle_comment.user_id','=','user.user_id')
            ->select('circle_comment.user_id','circle_comment.circle_id','user.user_name','circle_comment.content')
            ->where('circle_comment.circle_id',$circle_id)
            ->get();

        foreach($info as $k => $v){
            $v->content = preg_replace_callback('/@E(.{6}==)/', function($r) {return base64_decode($r[1]);},$v->content);
        }

        return $info;

    }


















}